import React, { Component } from "react";
import * as api from "api/index";
import "./index.scss";
import Item from "antd-mobile/es/components/dropdown/item";
import res from "antd-mobile-icons/es/AaOutline";

class Love extends Component {
  constructor(props) {
    super(props);
    this.state = {
      loveList: [
        {
          id: "46d34b10-ae4d-11ec-ba5b-3bb17d65f78f",
          imageUrl:
            "https://img.villaday.com/images/merchant/11786/audit_house/7PbXJtcpwr.jpg",
          name: "深圳较场尾·蔚蓝沿海民宿6房",
          showMinAverage: "60",
          showMinPrice: "1080",
        },
      ],
    };
  }

  componentDidMount() {
    this.getLoveList();
  }

  getLoveList() {
    api.$loveList().then((res) => {
      console.log(res);
      this.setState({
        loveList: res.result,
      });
    });
  }

  

  render() {
    return (
      <div className="love-index">
        <ul className="list wrap jc-c">
          {this.state.loveList.map((item) => (
            <li className="item bg-fff w100" key={item.id}>
              <div className="box flex aic jc-sb ml-10">
                <img src={item.imageUrl} alt=""/>
                <div className="info fg1 ml-15 mt-20 rel">
                  <p className="address f14">{item.name}</p>
                  
                  <p className="money f14 abs">
                    <span>￥{item.showMinPrice}</span>
                    <span className="num ml-15">人均 : {item.showMinAverage}</span>
                  </p>
                </div>
              </div>
            </li>
          ))}
        </ul>
        <div className="finished flex jc-c aic">
          <p>没有更多数据了</p>
        </div>
      </div>
    );
  }
}

export default Love;
